
from rest_framework.serializers import ModelSerializer,SerializerMethodField

from app1.models import *
class YonghuSer(ModelSerializer):
    class Meta:
        model=Yonghu
        fields='__all__'

class LibarySer(ModelSerializer):
    class Meta:
        model=Libary
        fields='__all__'



class CheSer(ModelSerializer):
    class Meta:
        model=Che
        fields='__all__'


class CheSer1(ModelSerializer):
    uid=YonghuSer()
    pid=LibarySer()
    class Meta:
        model=Che
        fields='__all__'

class CartListSer(ModelSerializer):
    book=LibarySer()
    class Meta:
        model=Libary
        fields='__all__'